import {request} from "@/common/ajax";

// 登录
export function login(data, success, error) {
    return request('login', 'post', data, success, error);
}

// 获取登录信息
export function loginInfo(success, error) {
    return request('login_info', 'get', {}, success, error);
}

// 修改密码
export function changePwd(data, success, error) {
    return request('ch_pwd', 'post', data, success, error);
}

// 刷新全局缓存
export function refreshCache(success, error) {
    return request('role/refresh', 'get', {}, success, error);
}

// 菜单
export function rules(data, success, error) {
    return request('rule/rule', 'get', data, success, error);
}

export function ruleMenus(data, method, success, error) {
    return request('rule/menu', method, data, success, error);
}

export function ruleAct(data, method, success, error) {
    return request('rule/act', method, data, success, error);
}

export function rulePostDel(data, success, error) {
    return request('rule/del', 'post', data, success, error);
}

export function ruleSequence(data, success, error) {
    return request('rule/sequence', 'post', data, success, error);
}

// 管理员账号
export function getAccount(data, success, error) {
    return request('admin/lists', 'get', data, success, error);
}

export function saveAccount(data, success, error) {
    return request('admin/save', 'post', data, success, error);
}

export function accountStatus(data, success, error) {
    return request('admin/status', 'post', data, success, error);
}

export function accountRole(method, data, success, error) {
    return request('admin/role', method, data, success, error);
}

// 角色
export function getRole(data, success, error) {
    return request('role/lists', 'get', data, success, error);
}

export function roleSave(data, success, error) {
    return request('role/save', 'post', data, success, error);
}

export function roleRule(method, data, success, error) {
    return request('role/rule', method, data, success, error);
}

export function roleStatus(data, success, error) {
    return request('role/status', 'post', data, success, error);
}

export function rolePostDel(data, success, error) {
    return request('role/del', 'post', data, success, error);
}

// APP
export function appLists(data, success, error) {
    return request('app/lists', 'get', data, success, error);
}

export function appVersion(method, data, success, error) {
    return request('app/version', method, data, success, error);
}

// 帮助
export function docLists(data, success, error) {
    return request('doc/lists', 'get', data, success, error);
}

export function docInfo(method, data, success, error) {
    return request('doc/info', method, data, success, error);
}

// 用户
export function userLists(data, success, error) {
    return request('user/lists', 'get', data, success, error);
}

export function userDisable(data, success, error) {
    return request('user/disable', 'put', data, success, error);
}

// 反馈
export function feedbackLists(data, success, error) {
    return request('feedback/lists', 'get', data, success, error);
}

export function feedbackInfo(method, data, success, error) {
    return request('feedback/info', method, data, success, error);
}

// 配置
export function configLists(data, success, error) {
    return request('config/lists', 'get', data, success, error);
}

export function configValue(data, success, error) {
    return request('config/Value', 'put', data, success, error);
}

